﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace XEvents.Library
{
    internal struct server_event_session_event
    {
        internal int event_session_id;
        internal int event_id;
        internal string name;
        internal string package;
        internal string module;
        internal string predicate;

        internal server_event_session_event(SqlDataReader dr)
        {
            Int32.TryParse((dr["event_session_id"] == DBNull.Value ? "-1" : dr["event_session_id"]).ToString(), out event_session_id);
            Int32.TryParse((dr["event_id"] == DBNull.Value ? "-1" : dr["event_id"]).ToString(), out event_id);
            name = (dr["name"] == DBNull.Value ? string.Empty : dr["name"]).ToString();
            package = (dr["package"] == DBNull.Value ? string.Empty : dr["package"]).ToString();
            module = (dr["module"] == DBNull.Value ? string.Empty : dr["module"]).ToString();
            predicate = (dr["predicate"] == DBNull.Value ? string.Empty : dr["predicate"]).ToString();
        }
    }
}
